<template>
  <el-container style="height: 100%; border: 1px solid #eee">
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <div class="img">
        <img src="../../assets/images/header.png" alt="header" style="height: 60px;
    width: 15.5em;
    margin-left: -11px;"/>
      </div>

      <el-menu :default-openeds="[1]" :default-active="1">
        <el-menu-item index="1" @click="active=1">
          <template #title><i class="el-icon-message"></i>学生信息</template>
        </el-menu-item>
        <el-menu-item index="2" @click="active=2">
          <i class="el-icon-menu"></i>学分详情
        </el-menu-item>
        <el-menu-item index="3" @click="active=3">
          <template #title><i class="el-icon-setting"></i>申请&反馈</template>
        </el-menu-item>
<!--        <el-menu-item index="4" @click="active=0">-->
<!--          <i class="el-icon-menu"></i>个人信息-->
<!--        </el-menu-item>-->
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <template #dropdown>
<!--            <el-dropdown-menu>-->
<!--              <el-dropdown-item @click="active=0">个人信息</el-dropdown-item>-->
<!--            </el-dropdown-menu>-->
            <el-dropdown-menu>
              <el-dropdown-item @click="outLogin">退出</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
        <span style="margin-right: 15px;">{{ dataList.headername }}</span>

      </el-header>
      <!--      管理员个人信息-->
<!--      <template v-if="active === 0">-->
<!--        <el-main>-->
<!--          <el-row>-->
<!--            <el-col :span="10">-->
<!--              <profile/>-->
<!--            </el-col>-->
<!--            <el-col :span="10" :offset="4">-->
<!--              <notice/>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row>-->
<!--          </el-row>-->
<!--        </el-main>-->
<!--      </template>-->
      <!--      团支书信息列表-->
      <template v-if="active === 1">
        <league-party-secretary-information/>
      </template>
<!--      学分详情-->
      <template v-if="active === 2">
        <student-credit-details/>
      </template>
      <template v-if="active===3"><request-and-feedback/></template>
    </el-container>
  </el-container>



</template>

<script>
import qs from 'qs';
import {computed, ref, refs, defineComponent, getCurrentInstance, onMounted, reactive, toRefs, unref} from "vue";
import Header from '../../components/header/header'
import Profile from '../admin/childComps/Profile'
import LeaguePartySecretaryInformation from "./childComps/LeaguePartySecretaryInformationList/LeaguePartySecretaryInformation";
import StudentCreditDetails from "./childComps/StudentCreditDetails/StudentCreditDetails";
import RequestAndFeedback from "./childComps/RequestAndFeedback/RequestAndFeedback";
export default {
  // inject: ['reload'],
  data() {
    return {
      active :1
    };
  },
  components: {
    RequestAndFeedback,
    Header,
    Profile,
    LeaguePartySecretaryInformation,
    StudentCreditDetails
  },
  setup(props) {
    const dataList = reactive({
      headername: '',
    })
    console.log("admin"+localStorage.getItem('AdminName'))
    dataList.headername =  localStorage.getItem('AdminName')

    function outLogin(){
      window.location.href = 'http://localhost:8080/';
      //退出登录清除所有缓存
      localStorage.clear()
    }


    return {

      outLogin,
      dataList
    }
  }


}

</script>

<style>
.el-header {
  background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}


</style>
